Write data to a file at the specified row. The _s_a_m_p_l_e parameter is used
only if data are organized in separate planes (_P_l_a_n_a_r_C_o_n_f_i_g_u_r_a_t_i_o_n=2).
The data are assumed to be uncompressed and in the native bit- and byte-
order of the host machine. The data written to the file is compressed
according to the compression scheme of the current TIFF directory (see
further below). If the current scanline is past the end of the current
subfile, the _I_m_a_g_e_L_e_n_g_t_h field is automatically increased to include the
scanline (except for _P_l_a_n_a_r_C_o_n_f_i_g_u_r_a_t_i_o_n=2, where the _I_m_a_g_e_L_e_n_g_t_h cannot
be changed once the first data are written). If the _I_m_a_g_e_L_e_n_g_t_h is
increased, the _S_t_r_i_p_O_f_f_s_e_t_s and _S_t_r_i_p_B_y_t_e_C_o_u_n_t_s fields are similarly
enlarged to reflect data written past the previous end of image.
NNNNOOOOTTTTEEEESSSS
The library writes encoded data using the native machine byte order.
Correctly implemented TIFF readers are expected to do any necessary
byte-swapping to correctly process image data with BitsPerSample greater
than 8. The library attempts to hide bit-ordering differences between
the image and the native machine by converting data from the native
machine order.
In C++ the _s_a_m_p_l_e parameter defaults to 0.
Once data are written to a file for the current directory, the values of
certain tags may not be altered; see _T_I_F_F_S_e_t_F_i_e_l_d(3T) for more
information.
It is not possible to write scanlines to a file that uses a tiled
organization. The routine _T_I_F_F_I_s_T_i_l_e_d can be used to determine if the
file is organized as tiles or strips.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
_T_I_F_F_W_r_i_t_e_S_c_a_n_l_i_n_e returns -1 if it immediately detects an error and 1 for
a successful write.
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
All error messages are directed to the _T_I_F_F_E_r_r_o_r(3T) routine.
%%%%ssss:::: FFFFiiiilllleeee nnnnooootttt ooooppppeeeennnn ffffoooorrrr wwwwrrrriiiittttiiiinnnngggg .... The file was opened for reading, not
writing.
CCCCaaaannnn nnnnooootttt wwwwrrrriiiitttteeee ssssccccaaaannnnlllliiiinnnneeeessss ttttoooo aaaa ttttiiiilllleeeedddd iiiimmmmaaaaggggeeee. An attempt was made to write a
scanline to a tiled image. The image is assumed to be organized in tiles
because the _T_i_l_e_W_i_d_t_h and _T_i_l_e_L_e_n_g_t_h tags have been set with
CCCCoooommmmpppprrrreeeessssssssiiiioooonnnn aaaallllggggoooorrrriiiitttthhhhmmmm ddddooooeeeessss nnnnooootttt ssssuuuuppppppppoooorrrrtttt rrrraaaannnnddddoooommmm aaaacccccccceeeessssssss. Data was written
in a non-sequential order to a file that uses a compression algorithm and
that has _R_o_w_s_P_e_r_S_t_r_i_p greater than one. That is, data in the image is to
be stored in a compressed form, and with multiple rows packed into a
strip. In this case, the library does not support random access to the
data. The data should either be written as entire strips, sequentially
by rows, or the value of _R_o_w_s_P_e_r_S_t_r_i_p should be set to one.
%%%%ssss:::: MMMMuuuusssstttt sssseeeetttt """"IIIImmmmaaaaggggeeeeWWWWiiiiddddtttthhhh"""" bbbbeeeeffffoooorrrreeee wwwwrrrriiiittttiiiinnnngggg ddddaaaattttaaaa. The image's width has not
be set before the first write. See _T_I_F_F_S_e_t_F_i_e_l_d(3T) for information on
how to do this.
%%%%ssss:::: MMMMuuuusssstttt sssseeeetttt """"PPPPllllaaaannnnaaaarrrrCCCCoooonnnnffffiiiigggguuuurrrraaaattttiiiioooonnnn"""" bbbbeeeeffffoooorrrreeee wwwwrrrriiiittttiiiinnnngggg ddddaaaattttaaaa. The organization
of data has not be defined before the first write. See _T_I_F_F_S_e_t_F_i_e_l_d(3T)
for information on how to do this.
CCCCaaaannnn nnnnooootttt cccchhhhaaaannnnggggeeee """"IIIImmmmaaaaggggeeeeLLLLeeeennnnggggtttthhhh"""" wwwwhhhheeeennnn uuuussssiiiinnnngggg sssseeeeppppaaaarrrraaaatttteeee ppppllllaaaannnneeeessss. Separate image
planes are being used (_P_l_a_n_a_r_C_o_n_f_i_g_u_r_a_t_i_o_n=2), but the number of rows has
not been specified before the first write. The library supports the
dynamic growth of an image only when data are organized in a contiguous
%%%%dddd:::: SSSSaaaammmmpppplllleeee oooouuuutttt ooooffff rrrraaaannnnggggeeee,,,, mmmmaaaaxxxx %%%%dddd. The _s_a_m_p_l_e parameter was greater than
the value of the SamplesPerPixel tag.
%%%%ssss:::: NNNNoooo ssssppppaaaacccceeee ffffoooorrrr ssssttttrrrriiiipppp aaaarrrrrrrraaaayyyyssss .... There was not enough space for the
arrays that hold strip offsets and byte counts.
BBBBUUUUGGGGSSSS
Writing subsampled YCbCR data does not work correctly because, for
_P_l_a_n_a_r_C_o_n_f_i_g_u_r_a_t_i_o_n=2 the size of a scanline is not calculated on a per-
sample basis, and for _P_l_a_n_a_r_C_o_n_f_i_g_u_r_a_t_i_o_n=1 the library does not pack the